<template>
  <!-- 基本信息 -->
  <div style="height:600px;">
    <FormPanel
      :list="initForm"
      :cols="3"
      formType="show"
      :labelWidth="120"
      :isSubmitBtn="false"
      @formChange="formChangeHandle"
      class="mtop"
    />
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
export default {
  mixins: [dictionary],
  props: {
    value: {
      type: Number,
      required: true
    },
    infoBasic: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      initForm: this.initFormFun(),
      formValue: {}
    };
  },
  created() {
    this.init();
  },
  methods: {
    //初始化数据
    init() {
      console.log('行id---->', this.value);
      console.log('是否编辑---->', this.infoBasic);
      //赋值
      // this.initForm.forEach(x => {
      //     x.initialValue = data.row[x.fieldName];
      // });
    },
    //搜索数据
    initFormFun() {
      return [
        {
          type: 'INPUT',
          label: '客户公司名称',
          fieldName: 'field1',
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '客户类型',
          fieldName: 'field2',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '客户性质',
          fieldName: 'field3',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '客户状态',
          fieldName: 'field4',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '客户来源',
          fieldName: 'field5',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'DATE',
          label: '建档时间',
          fieldName: 'field6',
          valueFormat: 'yyyy-MM-dd',
          style: { width: '100%' },
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '省份',
          fieldName: 'field7',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '市',
          fieldName: 'field8',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '区',
          fieldName: 'field9',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'TEXT_AREA',
          label: '详细地址',
          fieldName: 'field10',
          rows: 1,
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '所属行业分类',
          fieldName: 'field11',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '行业地位',
          fieldName: 'field12',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '采购方式',
          fieldName: 'field13',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '意向车型',
          fieldName: 'field14',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'INPUT_NUMBER',
          label: '预计采购数量',
          fieldName: 'field141',
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '购车用途',
          fieldName: 'field15',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'DATE',
          label: '预计采购日期',
          fieldName: 'field16',
          valueFormat: 'yyyy-MM-dd',
          style: { width: '100%' },
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '预算来源',
          fieldName: 'field17',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'INPUT_NUMBER',
          label: '年度预算',
          fieldName: 'field171',
          initialValue: '',
          precision: 2
        },
        {
          type: 'SELECT',
          label: '上牌城市',
          fieldName: 'field18',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'SELECT',
          label: '是否跨区销售',
          fieldName: 'field19',
          initialValue: '',
          itemList: this.createDictList('1008')
        },
        {
          type: 'INPUT',
          label: '融资渠道',
          fieldName: 'field20',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '客户关键联系人',
          fieldName: 'field21',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '联系方式',
          fieldName: 'field22',
          initialValue: ''
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          fieldName: 'field23',
          rows: 2,
          initialValue: ''
        }
      ];
    },
    formChangeHandle(val) {
      this.formValue = val;
    }
  }
};
</script>